home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
200_01
/
copy.sci
< prev
next >
Wrap
Text File
|
1980-01-01
|
512b
|
23 lines
#
# Sample file copy program for SCI (version 1.4)
#
copy(f,t)
char *f, *t;
{
int infd, outfd;
char buf[128],len;
if ( (infd=fopen(f,"r")) < 0 )
return err(f);
if ( (outfd=fopen(t,"w")) < 0 )
return err(t);
while( (len=fread(buf,128,infd))>0 )
fwrite(buf,len,outfd);
fclose(outfd);
fclose(infd);
}
err(f)
{
printf("can't open <%s>\n",f);
}